<%-- 
    Document   : courierDboardMain
    Created on : Apr 20, 2013, 1:39:21 PM
    Author     : Andriy
--%>

<%@page import="entity.Orders"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <div id="main">
            <div id="tabl" >

                <table width="90%">

                    <TR>
                        <td id="head_table_first" >Order </td>
                        <td id="head_table_second">Order Date </td>
                        <td id="head_table_third">  Order Status</td>
                        <td id="head_table_second">Warehouse </td>
                        <td id="head_table_second">Address </td>
                        <td id="head_table_third">  Shipping price</td>
                        <td id="head_table_third">  Product price</td>
                        <td id="head_table_second">Delivery </td>
                    </TR>

                    <% List<Orders> ordersList = (List) request.getAttribute("ordersList");
                        for (Iterator<Orders> itr = ordersList.iterator(); itr.hasNext();) {
                            Orders o = itr.next();%>
                    <TR>
                        <td id="head_table_first" > <%=o.getIdOrder()%></td>   
                        <td id="head_table_first" > <%=o.getOrderDate()%></td>  
                        <td id="head_table_first" > <%=o.getOrderStatus()%></td> 
                        <td id="head_table_first" > <%=o.getIdWarehouse().getName()%></td> 
                        <td id="head_table_first" > <%=o.getAddress()%></td>
                        <td id="head_table_first" > <%=o.getShippingPrice()%></td>
                        <td id="head_table_first" > <%=o.getProductPrice()%></td>
                        <td>
                            <form method="GET" action="courier">
                            <input type="hidden" name="idOrderDel" value="<%=o.getIdOrder()%>"/>
                            <input type="submit" value="Deliver"/> </form></td>
                   </TR>
                        <%}%>
                </table>
                        <%for(int i=1;i<=(Integer)request.getAttribute("count")/10;i++){%>
                    <a href="/Delta-war/courier">[<%=i%>]</a>
                <%}%>
             </div>

        </div>
  </body>
</html>
